<div class="table-head fn-clear">
    <div class="fn-l">
    <form name="search" id="search" action="{url('bom/add_bom',array('id'=>$id))}" method="post">
      产品名称: 
      <select class="select" name="producttype_id" datatype="*">
          <option value=""></option>
      {loop $producttype_lists $vo} 
          <option value="{$vo['id']}" {if $producttype_id == $vo['id']} selected="selected"{/if}>{$vo['name']}</option>
      {/loop}
      </select>
      物料代码: <input class="input w80" datatype="*" type="text" name="code" value="{$code}" />
      物料名称: <input class="input w80" datatype="*" type="text" name="name" value="{$name}" />
      <input type="submit" value="查找" class="button" />
    </form>
    </div>  
</div>
<div class="m10 w600">
<form id="form" action="{url('bom/add_bom_save')}">
<input type="hidden" name="id" value="{$id}"/> 
<table class="table table-border">
<thead>
    <tr>
        <td class="w20 fn-tac">#</td>
        <td class="w40 fn-tac">数量</td>
        <td>产品名称</td>
        <td class="w100 fn-tac">物料代码</td>
        <td>物料名称</td>
    </tr>
</thead>
<tbody>
{loop $list $vo}
<tr>
    <td class="fn-tac"><input type="checkbox" name="bom_id[]" value="{$vo['id']}" {if in_array($vo['id'],$bom_list)} checked="checked"{/if} /></td>
     <td class="fn-tac">
<select class="select" name="number[{$vo['id']}]">
    <option value="1" {if $number_id[$vo['id']] == 1}selected="selected"{/if}>1</option>
    <option value="2" {if $number_id[$vo['id']] == 2}selected="selected"{/if}>2</option>
    <option value="3" {if $number_id[$vo['id']] == 3}selected="selected"{/if}>3</option>
    <option value="4" {if $number_id[$vo['id']] == 4}selected="selected"{/if}>4</option>
    <option value="5" {if $number_id[$vo['id']] == 5}selected="selected"{/if}>5</option>
</select>
     </td>
     <td>{$vo['product']}</td>
    <td class="fn-tac">{$vo['code']}</td>
    <td>{$vo['name']}</td>
</tr>
{/loop}
</tbody>
</table>
<div id="page" class="fn-clear">
    <div class="fn-l"><input type="submit" value="确定保存" class="button button-blue" /></div>
    <div class="fn-r">{$pager}</div>
</div>
</form>
</div>
<script type="text/javascript">
Do('base','form','date','dialog',function(){ 
    $('#form').forms();
})
</script>